/*  
 *  Copyright RobOtter (2008) 
 * 
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/** \file compass.h
  *
  * Manage communication with the electronic compasss via I2C
  */

#ifndef COMPASS_H
#define COMPASS_H

#include <aversive.h>

/** \brief Compass I2C address */
#define COMPASS_I2C_ADDRESS 0x60

/** \brief MSB 16bit bearing register */
#define COMPASS_16BIT_BEARING_MSB 2

/** \brief LSB 16bit bearing register */
#define COMPASS_16BIT_BEARING_LSB 3

/** \brief Initialize I2C communication with compass */
void compass_init(void);

/** \brief Get measured bearing in dozens of degrees (0-3599)*/
uint16_t compass_getBearing_deg(void);

/** \brief Get measured bearing in radians */
double compass_getBearing_rad(void);


#endif/*COMPASS_H*/
